<?php
/* @var $this ShopPageController */
/* @var $model ShopPage */
/* @var $form CActiveForm */
?>
<script src="<?php echo Yii::app()->baseUrl . '/ckeditor/ckeditor.js'; ?>"></script>
<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'shop-page-_shoppage-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
    ));
    ?>



    <?php echo $form->errorSummary($model); ?>

    
    <div class="form_left">
        <?php echo $form->labelEx($model, 'shopid'); ?>
    </div>
    <div class="form_right">
        <?php
        $session = new CHttpSession;
        $session->open();
        $userID = $session['user_salesmart'][3];

        $listshop = Shop::model()->findAll('flag in(1,4) and uid=' . $userID);

        $list = CHtml::listData($listshop, 'id', 'shopName');

        echo $form->dropDownList($model, 'shopid', $list);
        ?>
        <?php echo $form->error($model, 'shopid'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'assia'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'assia', array('size' => 50, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'assia'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'title'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textField($model, 'title', array('size' => 50, 'maxlength' => 200, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'title'); ?>
    </div>
    <div class="clear"></div>


    <div class="form_left">
        <?php echo $form->labelEx($model, 'keyword'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'keyword', array('size' => 50, 'maxlength' => 500, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'keyword'); ?>
    </div>
    <div class="clear"></div>
    <div class="form_left">
        <?php echo $form->labelEx($model, 'deskiption'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'deskiption', array('size' => 50, 'maxlength' => 500, 'required' => 'required')); ?>
        <?php echo $form->error($model, 'deskiption'); ?>
    </div>
    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'flag'); ?>
    </div>
    <div class="form_right">

        <?php echo $form->dropDownList($model, 'flag', array('0' => 'Đang ẩn', '1' => 'Đang hiện')); ?>
    </div>
    <div class="clear"></div>

    <div class="form_left">
        <?php echo $form->labelEx($model, 'content'); ?>
    </div>
    <div class="form_right">
        <?php echo $form->textArea($model, 'content', array('id' => 'editor1')); ?>
        <?php echo $form->error($model, 'content'); ?>
    </div>
    <div class="clear"></div>
    <div class="clear"></div>
    <div class="row buttons">
        <?php echo CHtml::submitButton('Cập nhật'); ?>
    </div>

    <?php $this->endWidget(); ?>
    <script type="text/javascript">
        CKEDITOR.replace('editor1', {
            filebrowserBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/browse.php?type=files',
            filebrowserImageBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/browse.php?type=images',
            filebrowserFlashBrowseUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/browse.php?type=flash',
            filebrowserUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/upload.php?type=files',
            filebrowserImageUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/upload.php?type=images',
            filebrowserFlashUploadUrl: '<?php echo Yii::app()->baseUrl; ?>/kcfinder_1/upload.php?type=flash'
        });
    </script>

   

</div><!-- form -->